function showSon(span) {
    if (span.className === "has_children") {
        span.className = "";
        span.nextElementSibling.className = "hide";
    } else {
        var oldSpan = document.querySelector(".has_children");
        if (oldSpan != null) {
            oldSpan.className = "";
            oldSpan.nextElementSibling.className = "hide";
        }
        span.className = "has_children";
        span.nextElementSibling.className = "show";
    }
}

$(function () {
    setUsername();
});

function setUsername() {
    let result = myAjax('/back/manage/getName', 'get', {token: $.cookie("token")});
    if (result == null) {
        window.open("/login.html");
    } else {
        $("#user_name").html(result.un);
    }
}

function flushCookie() {
    $.cookie("token",null,{path:"/"});
}